package com.qfjy.service.impl.example1;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class EmailServiceImpl {

    @Value("${server.port}")
    private int port;

    //此注解用来监听MQ上是否有队列消息
    @RabbitListener(queues = "emailQueue")
    public void sendEmail( String cardId){
        log.info("发送邮件成功---》{}--->端口号：{}",cardId,port);
    }
}
